package xidw_api

import (
	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
	"server/apps/xidw/xidw_mod"
	"server/global"
	"server/model/common/response"
)

type JwtApi struct{}

func (j *JwtApi) JsonInBlacklist(c *gin.Context) {
	token := c.Request.Header.Get("x-token")
	jwt := xidw_mod.JwtBlacklist{Jwt: token}
	err := jwtService.JsonInBlacklist(jwt)
	if err != nil {
		global.Logger.Error("jwt作废失败!", zap.Error(err))
		response.FailWithMessage("jwt作废失败", c)
		return
	}
	response.OkWithMessage("jwt作废成功", c)
}
